package com.cuit.qx.controller;


import com.cuit.qx.entity.AcquisitionMonitoring;
import com.cuit.qx.service.AcquisitionMonitoringService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import com.cuit.qx.utils.ReturnData;
import com.cuit.qx.utils.ReturnStateCode;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 采集监控
 * </p>
 *
 * @author lcj
 * @since 2021-11-23
 */
@CrossOrigin(origins = "*", maxAge = 3600)
@RestController
@RequestMapping("/api/acquisitionMonitoring")
public class AcquisitionMonitoringController {

    @Autowired
    private AcquisitionMonitoringService ac;

    @RequestMapping("/list")
    public ReturnData getList(){

        List<AcquisitionMonitoring> list = ac.list();

        if (list != null && list.size()>0) {
            return new ReturnData(ReturnStateCode.SUCCEE.getCode(), ReturnStateCode.SUCCEE.getMsg(), list);
        } else {
            return new ReturnData(ReturnStateCode.FAILED.getCode(), ReturnStateCode.FAILED.getMsg(),  new ArrayList<>());
        }

    }



}
